//
//  OMOrderListViewCell.m
//  ERP
//
//  Created by QA on 15/9/20.
//  Copyright (c) 2015年 ShangHai HaoLei Software Technology Co., Ltd. All rights reserved.
//

#import "OMOrderListViewCell.h"

@implementation OMOrderListViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier index:(NSInteger)index
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"OMOrderListViewCell" owner:self options:nil];
        self = [topLevelObjects objectAtIndex:index];
        [self initData];
    }
    
    return self;
}

- (void)initData
{
    self.copysOrderButton.layer.masksToBounds = YES;
    self.copysOrderButton.layer.cornerRadius = 3.0;
    self.copysOrderButton.layer.borderWidth = 0.5;
    self.copysOrderButton.layer.borderColor = [[UIColor lightGrayColor] CGColor];
    
    self.changeButton.layer.masksToBounds = YES;
    self.changeButton.layer.cornerRadius = 3.0;
    self.changeButton.layer.borderWidth = 0.5;
    self.changeButton.layer.borderColor = [[UIColor lightGrayColor] CGColor];
}

- (void)setFrame:(CGRect)frame
{
    frame.origin.x += 6;
    frame.size.width = SuperWidth - 12;
    [super setFrame:frame];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}

- (void)drawHandlerButton
{
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(SuperWidth - 80, 4, 70, 28);
    [button setTitle:@"删除订单" forState:UIControlStateNormal];
    button.titleLabel.font = [UIFont systemFontOfSize:13];
    [button setTitleColor:[UIColor colorWithWhite:0 alpha:0.65] forState:UIControlStateNormal];
    
    button.layer.cornerRadius = 4;
    button.layer.masksToBounds = YES;
    button.layer.borderWidth = 1;
    button.layer.borderColor = [[UIColor colorWithWhite:0 alpha:0.65] CGColor];
    [self.contentView addSubview:button];
}

@end
